$(document).ready( function() {
	var scriptURL=$("#URL").val();
	var ajaxUrl=$("#infoURL").val();
		$("#fileupload").uploadify( {
			'height' :32,
			'width' :120,
			'uploader' :'../resource/js/uploadify-2.swf',
			'script' :'shuzi/sz/uploadAction.action',
			'cancelImg' :'../resource/images/cha.gif',
			'queueID' :'fileQueue',
			'auto' :false,
			'multi' :true,
			'buttonImg' :'../resource/images/choose_file.gif',
			'queueSizeLimit' :5,
			'fileDataName' :'files',
            'fileExt' : '*.bvh',
            'fileDesc' : '.bvh',
			onComplete :function(event, queueID, fileObj, response, data){
				add_table(event, queueID, fileObj, response, data);
			},
			onAllComplete : function() {
			}
		});
	function add_table(event, queueID, fileObj, response, data){
		var mess_table=document.getElementById("template_ta").cloneNode(true);
	        mess_table.style.display="block";
	        mess_table.id="table_"+response;
	    var table_con=document.getElementById("table_con");
			mess_table.getElementsByTagName("tr")[0].getElementsByTagName("td")[0].innerHTML=fileObj["name"];
			mess_table.getElementsByTagName("input")[0].value=response;
		var now_ta=table_con.appendChild(mess_table);
		$(now_ta).find("form input[name=tableId]").val("table_"+response);
		$(now_ta).find(".submit_pic").click(function(){
			$(now_ta).find("form")[0].submit();
			return false;
		});
	}
});


